<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>RabbitMQ延时插件完全指南</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        /* Hero Section */
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            position: relative;
            overflow: hidden;
        }
        
        .hero-gradient::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
        }
        
        /* Typography */
        .serif-title {
            font-family: 'Noto Serif SC', serif;
            letter-spacing: 0.05em;
        }
        
        /* Cards */
        .feature-card {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        
        .feature-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        }
        
        /* Code blocks */
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 12px;
            position: relative;
            overflow: hidden;
        }
        
        .code-block::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 40px;
            background: #2d2d2d;
            border-bottom: 1px solid #3e3e3e;
        }
        
        .code-block pre {
            margin-top: 40px;
            padding: 20px;
            overflow-x: auto;
        }
        
        /* Timeline */
        .timeline-item {
            position: relative;
            padding-left: 40px;
        }
        
        .timeline-item::before {
            content: '';
            position: absolute;
            left: 10px;
            top: 30px;
            bottom: -30px;
            width: 2px;
            background: linear-gradient(to bottom, #667eea, transparent);
        }
        
        .timeline-item:last-child::before {
            display: none;
        }
        
        .timeline-dot {
            position: absolute;
            left: 0;
            top: 8px;
            width: 20px;
            height: 20px;
            background: #667eea;
            border-radius: 50%;
            border: 4px solid #f5f7fa;
            box-shadow: 0 0 0 2px #667eea;
        }
        
        /* Animations */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .fade-in-up {
            animation: fadeInUp 0.6s ease-out;
        }
        
        /* Mermaid diagram styling */
        .mermaid {
            background: white;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }
        
        /* Section dividers */
        .section-divider {
            height: 2px;
            background: linear-gradient(to right, transparent, #667eea, transparent);
            margin: 60px 0;
        }
        
        /* Highlight box */
        .highlight-box {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            color: white;
            padding: 20px 30px;
            border-radius: 12px;
            position: relative;
            overflow: hidden;
        }
        
        .highlight-box::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            animation: pulse 3s ease-in-out infinite;
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); opacity: 0.5; }
            50% { transform: scale(1.1); opacity: 0.3; }
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-6 relative">
        <div class="max-w-6xl mx-auto text-center relative z-10">
            <h1 class="serif-title text-5xl md:text-7xl font-bold mb-6 fade-in-up">
                RabbitMQ延时插件
            </h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90 fade-in-up" style="animation-delay: 0.2s;">
                掌握消息延时投递的艺术，构建更智能的分布式系统
            </p>
            <div class="flex justify-center space-x-4 fade-in-up" style="animation-delay: 0.4s;">
                <span class="inline-flex items-center px-4 py-2 bg-white bg-opacity-20 rounded-full">
                    <i class="fas fa-clock mr-2"></i> 延时消息
                </span>
                <span class="inline-flex items-center px-4 py-2 bg-white bg-opacity-20 rounded-full">
                    <i class="fas fa-layer-group mr-2"></i> 任务调度
                </span>
                <span class="inline-flex items-center px-4 py-2 bg-white bg-opacity-20 rounded-full">
                    <i class="fas fa-sync-alt mr-2"></i> 消息重试
                </span>
            </div>
        </div>
    </section>

    <!-- Introduction Section -->
    <section class="py-16 px-6">
        <div class="max-w-4xl mx-auto">
            <div class="feature-card p-8 rounded-2xl shadow-xl mb-12">
                <h2 class="serif-title text-3xl font-bold mb-6 text-gray-800">
                    <i class="fas fa-lightbulb text-yellow-500 mr-3"></i>为什么需要延时插件？
                </h2>
                <p class="text-lg text-gray-700 leading-relaxed mb-6">
                    在实际的开发中，我们经常需要在消息发送之后延迟一段时间后再进行消费，或者在某个特定的时间点触发某些任务的执行。传统的做法可能是通过编写定时任务或者手动处理，但这种方式通常不够灵活和高效。
                </p>
                <p class="text-lg text-gray-700 leading-relaxed">
                    而 RabbitMQ 延时插件的出现，为我们提供了一种更加简单和便捷的解决方案。通过 RabbitMQ 延时插件，我们可以轻松地设置消息的延时发送和消费时间，而无需编写复杂的定时任务或者手动处理逻辑。这不仅大大简化了开发流程，提高了开发效率，同时也增强了系统的可靠性和稳定性。
                </p>
            </div>
        </div>
    </section>

    <!-- Concepts Visualization -->
    <section class="py-16 px-6 bg-gray-50">
        <div class="max-w-6xl mx-auto">
            <h2 class="serif-title text-4xl font-bold text-center mb-12 text-gray-800">
                核心概念解析
            </h2>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div class="feature-card p-8 rounded-2xl">
                    <div class="flex items-center mb-4">
                        <div class="w-12 h-12 bg-purple-500 rounded-full flex items-center justify-center text-white mr-4">
                            <i class="fas fa-hourglass-half"></i>
                        </div>
                        <h3 class="text-2xl font-bold text-gray-800">延迟消息</h3>
                    </div>
                    <p class="text-gray-700 leading-relaxed">
                        延迟消息是指在发送消息后，消息不会立即被投递给消费者，而是延迟一段时间后再进行投递。这种延迟的目的通常是为了在一定的时间后触发某些特定的事件或者处理某些业务逻辑，例如订单超时未支付处理、任务调度执行等。
                    </p>
                </div>
                
                <div class="feature-card p-8 rounded-2xl">
                    <div class="flex items-center mb-4">
                        <div class="w-12 h-12 bg-indigo-500 rounded-full flex items-center justify-center text-white mr-4">
                            <i class="fas fa-inbox"></i>
                        </div>
                        <h3 class="text-2xl font-bold text-gray-800">延迟队列</h3>
                    </div>
                    <p class="text-gray-700 leading-relaxed">
                        延迟队列是一种特殊类型的消息队列，用于存储延迟消息，并在一定的延迟时间后将消息投递给消费者进行处理。与普通队列不同的是，延迟队列可以设置消息的延迟时间，使得消息在指定的时间后才会被消费者接收到。
                    </p>
                </div>
            </div>

            <!-- Mermaid Diagram -->
            <div class="mermaid mx-auto" style="max-width: 800px;">
                graph LR
                    A[生产者] -->|发送延时消息| B[延时交换机]
                    B -->|路由| C[延时队列]
                    C -->|延时到期| D[消费者]
                    
                    style A fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                    style B fill:#764ba2,stroke:#fff,stroke-width:2px,color:#fff
                    style C fill:#f093fb,stroke:#fff,stroke-width:2px,color:#fff
                    style D fill:#f5576c,stroke:#fff,stroke-width:2px,color:#fff
            </div>
        </div>
    </section>

    <!-- Use Cases -->
    <section class="py-16 px-6">
        <div class="max-w-6xl mx-auto">
            <h2 class="serif-title text-4xl font-bold text-center mb-12 text-gray-800">
                延时插件的应用场景
            </h2>
            
            <div class="grid md:grid-cols-3 gap-6">
                <div class="feature-card p-6 rounded-xl text-center">
                    <div class="w-16 h-16 bg-gradient-to-br from-purple-500 to-pink-500 rounded-full flex items-center justify-center text-white mx-auto mb-4">
                        <i class="fas fa-tasks text-2xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">消息调度和任务延时执行</h3>
                    <p class="text-gray-600">
                        延时插件可以用于实现消息的调度和任务的延时执行。例如，你可以将某个需要延时执行的任务封装成一条消息，然后将这条消息发送到 RabbitMQ 中，指定它在未来的某个时间点才被消费者处理。
                    </p>
                </div>
                
                <div class="feature-card p-6 rounded-xl text-center">
                    <div class="w-16 h-16 bg-gradient-to-br from-indigo-500 to-blue-500 rounded-full flex items-center justify-center text-white mx-auto mb-4">
                        <i class="fas fa-redo text-2xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">消息重试和超时处理</h3>
                    <p class="text-gray-600">
                        在消息处理系统中，经常会遇到需要对消息进行重试或者在超时后进行处理的情况。延